<%--
  Created by IntelliJ IDEA.
  User: xiaobo
  Date: 2014/10/24
  Time: 14:57
  To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"  pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="spring" uri="/WEB-INF/lib/spring.tld"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib prefix="z" uri="/WEB-INF/lib/zerdoor.tld"%>
<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>

<html>
<head>
<title><spring:message code="home.head"/></title>
    <link href="${path}/style/acg/css/index.css" rel="stylesheet" type="text/css" />
    <script src="${path}/js/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="${path}/style/acg/js/jquery.jslides.js"></script>
    <script type="text/javascript">
        function replaceAll(str){
            var arr = str.split(",");
            var result="";
            for(var i=0;i<arr.length;i++){
                if(i == arr.length-1){
                    result += arr[i];
                }else{
                    result += arr[i]+"<br/>";
                }
            }
            return result;
        }
        function NewDate(str) {
            str = str.split(' ');
            str1 = str[0].split('-');
            str2 = str[1].split(':');
            var date = new Date();
            date.setUTCFullYear(str1[0], str1[1] - 1, str1[2]);
            date.setUTCHours(str2[0], str2[1], str2[2], 0);
            return date;
        }
        function getRTime(NowTime,EndTime,obj){
            var timmer;
            var EndTime= new Date(EndTime); //截止时间
            var NowTime = new Date(NowTime);
            var t =EndTime.getTime() - NowTime.getTime();

            var d=Math.floor(t/1000/60/60/24);
            var h=Math.floor(t/1000/60/60%24);
            var m=Math.floor(t/1000/60%60);
            var s=Math.floor(t/1000%60);

            $("#"+obj).html("<spring:message code="home.module2.stay"/>："+d + "天"+h + "时"+m + "分"+s + "秒");
            //setInterval(getRTime(NowTime,EndTime,obj),1000);
            NowTime = new Date(NowTime.getTime()+1000);
            setTimeout(function() {
                getRTime(NowTime,EndTime,obj);
            }, 1000)
        }

    </script>
</head>
<body>
<%--<c:set var="str" value="1111111111111111111111111111"></c:set>
字条串"${str}"的长度是${z:getLen(str)}<br/>
字条串"${str}"截取前5个字符：${z:substr(str,0,5)}<br/>
5除以3取整数是:${z:chufa(5,3) }--%>
<jsp:include page="../public/header.jsp">
    <jsp:param    name="home"    value="home"    />
</jsp:include>
<!--content-->
<!--广告图-->
<div class="mainbanner">
    <div class="wrapper clearfix">
        <div class="bannerlist">
            <ul id="slides">
                <c:set var="SPEED" value="5000"></c:set>
                <c:forEach var="ad" items="${ads}">
                    <li><a href="${ad.url}" title="${ad.title}" ><img src="/acgplat/${ad.imgurl}" /></a></li>
                    <c:set var="SPEED" value="${ad._interval*1000}"></c:set>
                </c:forEach>
                <script>
                    var SPEED='${SPEED}';
                </script>
            </ul>
        </div>
    </div>
</div>
<!--广告图-->
<!--招标ING-->
<div class="zhaobiaomain">
    <div class="wrapper">
        <div class="indextit"><span><a href="${path}/taskList/taskList.html" class="more"><spring:message code="home.module1.more"/></a></span><spring:message code="home.module1.title"/></div>
        <div class="zhaobiaolist">
            <ul class="clearfix">
                <c:forEach var="pro" items="${ongoingPro}" varStatus="p">
                <li <c:if test="${p.last}">class="nomr"</c:if>>
                    <a href="${path}/taskdetail/index.html?taskId=${pro.id}"><img src="${path}/${pro.pic}" width="292" height="180" /></a>
                    <div class="txt">
                        <h3><a href="${path}/taskdetail/index.html?taskId=${pro.id}">${pro.title}</a></h3>
                        <p><span class="price">￥<f:formatNumber value="${pro.total_price}" pattern="#,#00.00#"/> </span><span  class="more"><a href="${path}/taskdetail/index.html?taskId=${pro.id}"><spring:message code="home.module1.button"/></a></span></p>
                    </div>
                </li>
                </c:forEach>
            </ul>
        </div>
    </div>
</div>
<!--招标ING-->
<!--竞赛活动-->
<div class="threemain">
    <div class="wrapper">
        <div class="Contestbox">
            <div class="indextit"><span><a href="${path}/race/index.html" class="more"><spring:message code="home.module2.more"/></a></span><spring:message code="home.module2.title"/></div>
            <div class="Contestlist">
                <ul class="clearfix">
                    <c:forEach var="a" items="${activities}" varStatus="k">
                    <li <c:if test="${k.last}">class="nomr"</c:if>>
                        <a href="${path}/racedetail/index.html?raceId=${a.race_id}"><img src="${path}/${a.task_pic}" onlick="${a.task_id}" width="292" height="180" /></a>
                        <h3><a href="${path}/racedetail/index.html?raceId=${a.race_id}">${a.title}</a></h3>
                        <div class="time" id="race${k.index}"><script> getRTime(NewDate("${a.startTime}"),NewDate("${a.endTime}"),"race${k.index}")</script></div>
                        <div class="txt">
                            <script>document.write(replaceAll("${a.name}"))</script>
                        </div>
                        <div class="read"><a href="${path}/racedetail/index.html?raceId=${a.race_id}"><spring:message code="home.module2.button"/></a></div>
                    </li>
                    </c:forEach>
                </ul>
            </div>
        </div>
        <div class="Artistbox">
            <div class="indextit"><span><a href="${path}/artist/index.html" class="more"><spring:message code="home.module3.more"/></a></span><spring:message code="home.module3.title"/></div>
            <div class="Artistlist">
                <ul class="clearfix">
                    <c:forEach var = "a" items="${artists}" varStatus="k">
                    <li <c:if test="${k.last}">class="nomr"</c:if>>
                        <a href="${path}/artistPersonalHome/artistPersonalHome.html?receiver=${a.id}"><img src="${path}/${a.avatar}" width="292" height="180" /></a>
                        <div class="txt">
                            <h3><span>${a.artistLevel}</span><a href="">${a.nickname}</a></h3>
                            <p><spring:message code="home.module3.button" arguments="${a.total==''?0:a.total}" argumentSeparator=","/></p>
                        </div>
                    </li>
                    </c:forEach>
                </ul>
            </div>
        </div>
    </div>
</div>
<!--金牌客户-->
<div class="CustomerBox">
    <div class="wrapper">
        <div class="indextit"><span>
            <%--<a href="" class="more"><spring:message code="home.module4.more"/></a>--%>
        </span><spring:message code="home.module4.title"/></div>
        <div class="Customerlist">
            <ul class="clearfix">
                <c:forEach var="c" items="${coops}" varStatus="k">
                <li class="clearfix <c:if test="${(k.index+1)%3==0}">nomr</c:if>">
                    <div class="photo"><img src="${path}/${c.avatar}" width="214" height="146" /></div>
                    <div class="txt">
                        <h3><a href="${path}/principal/principalView.html?principalId=${c.baile_id}">${c.nickname}</a></h3>
                        <p>
                            <spring:message code="home.module4.span1" arguments="${c.proNum==''?0:c.proNum}" argumentSeparator=","/><br />
                            <f:formatNumber value='${c.totalPrice==null?0:c.totalPrice}' pattern='#,#00.00#' var="totalPrice"/>
                            <spring:message code="home.module4.span2" arguments="${totalPrice}" argumentSeparator=","/>
                            <br />
                            <spring:message code="home.module4.span3" arguments="${c.bidPersons==''?0:c.bidPersons}" argumentSeparator=","/>
                        </p>
                    </div>
                </li>
            </c:forEach>
            </ul>
        </div>
    </div>
</div>
<!--content-->
<jsp:include page="../public/footer.jsp"></jsp:include>
</body>
</html>
